# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Ben <contrasutra@myrealbox.com>

pkgname=sound-juicer
pkgver=3.38.0
pkgrel=1
pkgdesc="A lean and friendly audio CD extractor for GNOME"
url="https://wiki.gnome.org/Apps/SoundJuicer"
arch=(x86_64)
license=(GPL)
depends=(libmusicbrainz5 libdiscid gtk3 gst-plugins-base gst-plugins-good brasero iso-codes)
makedepends=(itstool appstream-glib git meson)
_commit=97c62e1a97821ea7bd0fb361fdf5d3ab59463a38  # tags/3.38.0^0
source=("git+https://gitlab.gnome.org/GNOME/sound-juicer.git#commit=$_commit"
        fix-docdir.diff)
sha256sums=('SKIP'
            'f6b11f7bec2cdc602d3ec87b630628d9e5f17d4397932442d27b757dee13cf4c')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  git apply -3 ../fix-docdir.diff
}

build() {
  arch-meson $pkgname build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  DESTDIR="$pkgdir" meson install -C build
}
